package main

import (
	"fmt"
	"io/ioutil"
	"net/http"
	"os"
)

func main() {
	http.HandleFunc("/list/", func(w http.ResponseWriter, r *http.Request) {
		path := r.URL.Path[len("/list/"):]
		f, err := os.Open(path)
		if err != nil {
			panic(err)
		}
		defer f.Close()
		b, err2 := ioutil.ReadAll(f)
		if err2 != nil {
			panic(err2)
		}
		w.Write(b)
	})
	err := http.ListenAndServe(":9999", nil)
	if err != nil {
		panic(err)
	}
	fmt.Printf()

}
